import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.hibernate.*;

import com.br.sistema.venda.HibernateUtil;

public class conectar {
	public static void main(String[] args) throws SQLException {
		String connectionUrl = "jdbc:sqlserver://localhost:1434;databaseName=Estudo;";
		Session sessao = null;
		try {
			sessao = HibernateUtil.getSession().openSession();
			System.out.print("conectou!");
		} catch (Exception e) {
			sessao.close();
			System.out.print("Fechou a conexão!");
		}

	}
}